package com.um.jdy.common.member.entity.model;

import cn.hutool.core.util.StrUtil;
import com.um.jdy.common.member.enums.CodeKey;

/**
 * @Title 验证码邮件模版
 * @Description
 * @Author renjunwei
 * @Date 2022/8/16 09:18
 */
public class CodeEmailTemplate {

    private String title = "[NoReply] %s";

    private String content = "Verification code for user %s: %s";

    private String type;

    private String code;

    public CodeEmailTemplate(CodeKey codeKey, String code){
        this.type = codeKey.name();
        this.code = code;
    }
    public String getTitle(){
        return String.format(this.title, this.type);
    }

    public String getContent(){
        return String.format(this.content, StrUtil.lowerFirst(this.type), this.code);
    }
}
